package com.blockmeta.bbs.businesslibrary.flutter;

import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugin.common.EventChannel;

public class StreamChannelFlutterPlugins {
    private static final String CHANNEL_NAME = "main_stream_channel";

    public static void register(BinaryMessenger messenger) {
        EventChannel eventChannel = new EventChannel(messenger, CHANNEL_NAME);
        eventChannel.setStreamHandler(new EventChannel.StreamHandler() {
            @Override
            public void onListen(Object arguments, EventChannel.EventSink events) {
//                Log.d("tingflutter",arguments.toString());
//                events.success("电量：" + getBatteryLevel());
                //events.error("111","出现错误","");
                //events.endOfStream();
            }

            @Override
            public void onCancel(Object arguments) {
            }
        });
    }

}
